<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:pe="http://primefaces.org/ui/extensions"
	xmlns:p="http://primefaces.org/ui">

<h:head>
</h:head>

<h:body>
	<h:form id="accountForm">
		<p:messages id="messages" autoUpdate="true" />

		<h:panelGrid columns="2">
			<p:outputLabel for="realNameInput" value="Név" />
			<p:inputText id="realNameInput"
				value="#{userDetailsService.currentUser.realName}" />

			<p:outputLabel for="pwd1" value="Jelszó" />
			<p:password id="pwd1"
				value="#{userDetailsService.currentUser.password}" match="pwd2"
				required="true" />
			<p:outputLabel for="pwd2" value="Jelszó ismét" />
			<p:password id="pwd2"
				value="#{userDetailsService.currentUser.password}" name="pwd2"
				required="true" />

			<p:outputLabel value="Nem" for="gender" />
			<p:selectOneRadio id="gender"
				value="#{registrationController.user.gender}">
				<f:selectItems value="#{enumService.genderValues}"
					var="g" itemValue="#{g}" itemLabel="#{g.toString()}" />
			</p:selectOneRadio>
			<p:outputLabel value="Súly" for="weightInput" />
			<pe:inputNumber id="weightInput" decimalPlaces="0" symbol=" kg"
				symbolPosition="s" thousandSeparator=" "
				value="#{userDetailsService.currentUser.weight}" />
			<p:outputLabel for="heightInput" value="Magasság" />
			<pe:inputNumber id="heightInput" decimalPlaces="0" symbol=" cm"
				symbolPosition="s" thousandSeparator=" "
				value="#{userDetailsService.currentUser.height}" />
			<p:outputLabel for="ageInput" value="Kor" />
			<pe:inputNumber id="ageInput" decimalPlaces="0" symbol=" év"
				symbolPosition="s" thousandSeparator=" "
				value="#{userDetailsService.currentUser.age}" />

			<p:commandButton value="Mentés" icon="ui-icon-disk" update="@form"
				render="@form" actionListener="#{accountController.updateUser()}"></p:commandButton>
		</h:panelGrid>
	</h:form>
</h:body>
</html>